package com.bcxk.order.config;

import com.bcxk.order.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author NieMingkun
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {


    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptors  = registry.addInterceptor(new LoginInterceptor());
        interceptors.addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
